package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.Map;

@Mapper
public interface UserMapper {
    @Select("select * from sky_take_out.user where openid=#{openid}")
    User getBYOpenid(String openid);

    void insert(User user);

    @Select("select * from sky_take_out.user where id=#{userId}")
    User getById(Long userId);


    //查询这天新增的用户
    Long sumByMap(Map<String, Object> map);

    @Select("select coalesce( count(*),0) from sky_take_out.user where create_time <#{end} ")
    Long count(LocalDateTime end);
}
